import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use './src/assets/scss/variables.scss';`
      }
    }

  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    },
    extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
  },
  server: {
    port: 3000,
    open: false,
    cors: true
  },
  build: {
    // 移除可能有问题的入口配置
    outDir: 'dist',
    assetsDir: 'assets',
    minify: 'terser'
  },
  optimizeDeps: {
    include: ['vue-router', 'vuex']
  },
  base: './',
  publicDir: 'public',
  extensions: ['vue','js', 'ts', 'jsx', 'tsx', 'json','scss','css']
})